package com.wechar.pub_account.entity;

import lombok.Data;

import java.util.Date;

@Data
public class Message {
    // 开发者微信号
    private String ToUserName;
    // 发送方帐号（一个OpenID）
    private String FromUserName;
    // 消息创建时间 （整型）
    private long CreateTime;
    // 消息类型（text/image/location/link）
    private String MsgType;
    // 消息id，64位整型
    private long MsgId;
    //内容
    private String Content;

    public Message(){}

    public Message(String toUserName, String fromUserName, String content){
        this.ToUserName = fromUserName;
        this.FromUserName = toUserName;
        this.Content = content;
        this.CreateTime = new Date().getTime();
        this.MsgId = this.CreateTime;
        this.MsgType = "text";
    }

    public Message(String toUserName, String fromUserName, String content, String msgType){
        this.ToUserName = fromUserName;
        this.FromUserName = toUserName;
        this.Content = content;
        this.CreateTime = new Date().getTime();
        this.MsgId = this.CreateTime;
        this.MsgType = msgType;
    }

}
